package com.mt.enums;

import lombok.Getter;

/**
 * @author Wang
 * @Description 座位状态枚举
 * @date 2020/12/17-14:39
 */
@Getter
public enum SeatStatus {
     ON(0, "启用"),
    OFF(1, "禁用/故障");

    private Integer code;

    private String msg;

    SeatStatus(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static int TypeCode(SeatStatus listType) {
        for (SeatStatus like :SeatStatus.values()){
            if (like.getMsg()==listType.getMsg()) {
                return like.getCode();
            }
        }
        return -1;
    }

    public static String TypeName(SeatStatus listType) {
        for (SeatStatus like :SeatStatus.values()){
            if (like.getCode().equals(listType.getCode())) {
                return like.getMsg();
            }
        }
        return null;
    }
}
